<style>
    td {
        border: 1px solid #D9E4EB;
    }

    th {
        border: 1px solid #D9E4EB;
        text-align: center;
    }
</style>
<form id="set_site_info" style="margin: 10px">
    <div style="margin:10px 20px;"></div>
    <table cellspacing="8" cellPadding="4" width="100%">
        <input type="hidden" name="id" value="<{$siteinfo.place_id}>">
        <tr>
            <td width="100" class="nboit-validatebox">场所名称：</td>
            <td><input class="easyui-textbox" type="text" name="name" value="<{$siteinfo.name}>"
                       style="width:auto" required="true"/></td>
        </tr>
        <tr>
            <td width="100" class="nboit-validatebox">场所性质：</td>
            <td>
                <select name="place_type" style="width:200px;" class="easyui-combobox" panelMaxHeight="200px"
                        data-options="true:false,panelHeight:'auto'" required="true">
                    <option value="-1">请选择所属性质</option>
                    <volist name="place_type_config" id="name">
                        <option value="<{$key}>"><{$name}></option>
                    </volist>
                </select>
            </td>
        </tr>
        <tr>
            <td width="100" class="nboit-validatebox">场所地址：</td>
            <td><input class="easyui-textbox" type="text" name="address" value="<{$siteinfo.address}>"
                       style="width:auto" required="true"/></td>
        </tr>
        <tr>
            <td width="100" class="nboit-validatebox">所属区域：</td>
            <td>
                <select name="area_id" style="width:150px;" class="easyui-combobox" panelMaxHeight="200px"
                        data-options="editable:false,panelHeight:'auto'" required="true">
                    <option value="-1">请选择所属区域</option>
                    <volist name="areas_list" id="name">
                        <if condition="$siteinfo['area_id'] ==$key">
                            <option value="<{$key}>" selected><{$name}></option>
                            <else/>
                            <option value="<{$key}>"><{$name}></option>
                        </if>
                    </volist>

                </select>
            </td>
        </tr>
        <tr>
            <td width="100" class="nboit-validatebox">所属行政区域：</td>
            <!--<td>-->
            <!--<select name="district[province]" class="easyui-combobox"   panelMaxHeight="100px" required="true" >-->
            <!--<option value="-1">请选择省份</option>-->
            <!--</select>-->
            <!--</td>-->
            <td>
                <input id="province" name="district[province]" style="width:80px;" class="easyui-combobox"
                       panelMaxHeight="100px" required="true" value="<{$siteinfo.district.province}>">
                <input id="city" required="true" name="district[city]" style="width:150px;" class="easyui-combobox"
                       panelMaxHeight="100px" value="<{$siteinfo.district.city}>">
                <input id="county" required="true" name="district[county]" style="width:150px;" class="easyui-combobox"
                       panelMaxHeight="100px" value="<{$siteinfo.district.county}>">
            </td>
            <!--<td>-->
            <!--  <input id="province" name="district[province]" style="width:80px;" class="easyui-combobox"
                     panelMaxHeight="100px" required="true" data-options="
               valueField: 'name', textField: 'name',
               url: '<{:U('admin/operation/getCityCountyInfo')}>',onSelect: function(rec){ var url = '<{:U('admin/operation/getCityCountyInfo')}>?level=2&name='+rec.name;
               $('#city').combobox('reload', url); }" value="<{$siteinfo.district.province}>">
              <input id="city" required="true" name="district[city]" style="width:150px;" class="easyui-combobox"
                     panelMaxHeight="100px" data-options="
               valueField: 'name', textField: 'name',
               onSelect: function(rec){ var url = '<{:U('admin/operation/getCityCountyInfo')}>?level=3&name='+rec.name;
               $('#county').combobox('reload', url); }" value="<{$siteinfo.district.city}>">
              <input id="county" required="true" name="district[county]" style="width:150px;" class="easyui-combobox"
                     panelMaxHeight="100px" data-options="valueField:'name',textField:'name'"
                     value="<{$siteinfo.district.county}>">-->
            </td>
        </tr>
        <tr>
            <td width="100" class="nboit-validatebox">所属街道：</td>
            <td>
                <input class="easyui-textbox" type="text" name="subdistrict" prompt="填入所属街道"
                       value="<{$siteinfo.subdistrict}>" style="width:100%" required="true"/>
            </td>
        </tr>
        <tr>
            <td width="100" class="nboit-validatebox">所属单位：</td>
            <td>
                <select name="company_id" style="width:200px;" class="easyui-combobox" panelMaxHeight="200px"
                        data-options="editable:false,panelHeight:'auto'" required="true">
                    <option value="-1">请选择所属单位</option>
                    <volist name="cp_list" id="name">
                        <if condition="$siteinfo['company_id']==$key">
                            <option value="<{$key}>" selected><{$name}></option>
                            <else/>
                            <option value="<{$key}>"><{$name}></option>
                        </if>
                    </volist>
                </select>
            </td>
        </tr>
        <tr>
            <td width="100">场所面积：</td>
            <td><input class="easyui-textbox" type="text" name="areas" value="<{$siteinfo.areas}>"
                       style="width:auto"/></td>
        </tr>
        <tr>
            <td width="100" class="nboit-validatebox">负责人：</td>
            <td><input type="text" required="true" class="easyui-textbox" name="manager" value="<{$siteinfo.manager}>">
            </td>
        </tr>
        <tr>
            <td width="100" class="nboit-validatebox">负责人电话：</td>
            <td><input class="easyui-textbox" type="text" name="manager_phone" value="<{$siteinfo.manager_phone}>"
                       style="width:auto" required="true"/></td>
        </tr>
        <tr>
            <td width="100">消控室电话：</td>
            <td><input class="easyui-textbox" type="text" name="control_room_phone"
                       value="<{$siteinfo.control_room_phone}>" style="width:auto"/></td>
        </tr>
        <tr>
            <td width="100">是否独立主机：</td>
            <td>
                <if condition="$siteinfo['has_local_server']=='yes'">
                    <input type="radio" name="has_local_server" value="yes" checked>是
                    <input type="radio" name="has_local_server" value="no">否
                    <else/>
                    <input type="radio" name="has_local_server" value="yes">是
                    <input type="radio" name="has_local_server" value="no" checked>否
                </if>
            </td>
        </tr>
        <tr>
            <td class="nboit-validatebox">场所管理员</td>
            <td>
                <select required="true" name="user_id" style="width:100px;" class="easyui-combobox"
                        panelMaxHeight="200px"
                        data-options="editable:false,panelHeight:'auto'">
                    <option value="-1">选择管理员</option>
                    <volist name="manager_list" id="name">
                        <if condition="$siteinfo['user_id']==$key">
                            <option value="<{$key}>" selected><{$name}></option>
                            <else/>
                            <option value="<{$key}>"><{$name}></option>
                        </if>
                    </volist>
                </select>
            </td>
        </tr>
        <tr>
            <td width="100" class="nboit-validatebox">场所坐标：</td>
            <td>
                <input type="hidden" name="position" id="position" value="<{$siteinfo.position}>">
                <!-- <iframe src="<{$map_url}>" frameborder="0" width="100%" height="200px"></iframe> -->
                <iframe src="/index.html" frameborder="0" width="100%" height="200px"></iframe>
            </td>
        </tr>
    </table>
</form>

<script type="text/javascript">
    $(function () {
        loadqsfCombobox();
    });

    function loadqsfCombobox() {
        var province = "<{$siteinfo.district.province}>";
        var city = "<{$siteinfo.district.city}>";
        var county = "<{$siteinfo.district.county}>";
        $('#province').combobox({
            url: "<{:U('admin/operation/getCityCountyInfo')}>",
            valueField: 'id',
            textField: 'name',
            filter: function (q, row) {
                var opts = $(this).combobox('options');
                return row[opts.textField].indexOf(q) > -1;
            },
            onLoadSuccess: function () {
                var url = "<{:U('admin/operation/getCityCountyInfo')}>?level=2&name=" + province;
                $("#city").combobox('reload', url);
            },
            onSelect: function (rec) {
                $("#city").combobox('clear');
                var url = "<{:U('admin/operation/getCityCountyInfo')}>?level=2&name=" + rec.name;
                $("#city").combobox('reload', url);
            },
            loadFilter: function (oData) {
                var data = oData;
                for (var i in data) {
                    data[i].id = data[i].name;
                }
                return data;
            }
        });
        //
        $('#city').combobox({
            url: '',
            valueField: 'id',
            textField: 'name',
            filter: function (q, row) {
                var opts = $(this).combobox('options');
                return row[opts.textField].indexOf(q) > -1;
            },
            onLoadSuccess: function () {
                var url = "<{:U('admin/operation/getCityCountyInfo')}>?level=3&name=" + city;
                $("#county").combobox('reload', url);
            },
            onSelect: function (rec) {
                $("#county").combobox('clear');
                var url = "<{:U('admin/operation/getCityCountyInfo')}>?level=3&name=" + rec.name;
                $("#county").combobox('reload', url);
            },
            loadFilter: function (oData) {
                var data = oData;
                for (var i in data) {
                    data[i].id = data[i].name;
                }
                return data;
            }
        });
        //
        $('#county').combobox({
            url: '',
            valueField: 'id',
            textField: 'name',
            filter: function (q, row) {
                var opts = $(this).combobox('options');
                return row[opts.textField].indexOf(q) > -1;
            },
            onLoadSuccess: function () {
                $('#county').combobox('setValue', county)
            },
            loadFilter: function (oData) {
                var data = oData;
                for (var i in data) {
                    data[i].id = data[i].name;
                }
                return data;
            }
        });
    };
</script>